<template>
    <section>
        <Table :columns="columns" :data="eventGrade"></Table>
    </section>
</template>
<script>
import { mapActions } from 'vuex'
import { formatData } from '@/utils/format'
export default {
    name:"eventGrade",
    props:['id'],
    data(){
        return{
            columns:[
                {
                    title:"次数",
                    key:"submint_count",
                    align:"center"
                },
                {
                    title:"提交者",
                    key:"submitter_name",
                    align:"center"
                },
                {
                    title:"提交时间",
                    key:"submit_time",
                    align:"center",
                    render(h,params) {
                        return h('div',formatData(params.row.submit_time))
                    },
                },
                {
                    title:"评审时间",
                    key:"evaluate_time",
                    align:"center",
                    render(h,params) {
                        return h('div',formatData(params.row.evaluate_time))
                    },
                },
                {
                    title:"得分",
                    key:"score",
                    align:"center"
                },
                {
                    title:"比赛阶段",
                    key:"state",
                    align:"center"
                },
                {
                    title:"排名",
                    key:"rank",
                    type:'index',
                    align:"center"
                },
                {
                    title:"提交内容",
                    key:"dataURL",
                    align:"center"
                },
            ],
            eventGrade:[],
        }
    },
    methods:{
        ...mapActions(['XgetScores'])
    },
    mounted(){
        this.XgetScores(this.id).then(res => {
            if(res.data){
                this.eventGrade.push(res.data)
            } 
        })
        .catch(err => {
            console.log(err.response)
        })
    }
}
</script>
<style lang="scss" scoped>

</style>
